10. Crazyflie Introduction
Getting Started With the Crazyflie
First things first, we will follow along with Bitcraze's detailed walkthrough to get our crazyflie all set up and ready to fly. Out of the box the crazyflie may not have the most up to date firmware, so we will make sure to follow Bitcraze's guide to making sure our crazyflie is completely up to date.
When following the guide, it's important to make sure we've installed the computer client and the necessary drivers for the antenna, as we will need to use both of these as we further configure the crazyflie and run our backyard flyer script on it.
Additional Setup
In addition to the setup steps outlined in the walkthrough, we want to configure our crazyflie radio connection to have a bit of a higher bandwidth. This will help to reduce some of the latency on getting information from the crazyflie when we are running the backyard flyer script.
To do so, we will open the client, navigate to Connect
, select the Configure 2.0
option and change the bandwidth from 250k
to 2M
.
A Note on Perception
The crazyflie is not equipped with GPS and therefore needs alternative means to be able to know its position information. The FlowDeck enables the crazyflie to determine position, however it does pose a few limitations that will need to be considered when controlling the crazyflie with the backyard flyer script.
With the FlowDeck, the Crazyflie uses optical flow to measure velocity to be used for a position estimate. This will drift over time, so the crazyflie may not be capable of doing very long straight flight segments when flying autonomously. This also means it doesn't really have an absolute frame of reference, which means it flies in a local XYZ frame, not an NED frame. In short, this means that when flying the backyard flyer, a 1m change North, will really just be a 1m change forward from the initial position and heading. This is the same for all subsequent commands (e.g. a 1m change E won't necessarily go E, but will go to the right 1m).
What was altitude is now height above the ground as the crazyflie uses a small laser range finder to determine its height above the ground. This results in 2 behaviors of importance. First, the sensor doesn't have unlimited range, therefore it is possible to fly "too high", being above the sensor's range and no longer being able to get good information. Second, it means that the crazyflie will follow the contours of the environment, meaning if we command a height of 1m but have the path go over a table, the crazyflie will increase it's height above the ground such that it is 1m above the table (its local perception of the ground).